import requests

from api.p2p_reg_login import RegLogin
from config import BASE_URL


class Tender(object):
    def __init__(self, session):
        self.__session = session
        self.__tender_url = BASE_URL + "/trust/trust/tender"

    def tender(self, data):
        return self.__session.post(url=self.__tender_url, data=data)


if __name__ == '__main__':
    session = requests.Session()
    reg_login = RegLogin(session)

    data1 = {"keywords": "13800005001", "password": "Aa123456"}
    reg_login.login(data1)
    data = {"id": 714,
            "depositCertificate": -1,
            "amount": 100}
    ten =Tender(session)
    ten.tender(data)
    resp=ten.tender(data)
    print(resp.json())



